﻿$(document).ready(function () {

    $('#btnEndStage1').click(function(){
        var jsonStage1 = {
            loanAmount: $('#txtLoanAmount').val(),
            loanTerm: $('#txtLoanTerm').val(),
            loanPurpose: $('#txtLoanPurpose').val(),
            typeFunding: $('#txtTypeFunding').val(),
            economicSector: $('#optEconomicSector').val(),
            annualReport: $('#txtAnnualReport').val(),
            currentAssets: $('#txtCurrentAssets').val(),
            currentLiabilities: $('#txtCurrentLiabilities').val(),
            inventory: $('#txtInventory').val(),
            cash: $('#txtCash').val(),
            notCurrentAssets: $('#txtNotCurrentAssets').val(),
            notCurrentLiabilities: $('#txtNotCurrentLiabilities').val(),
            netProfit: $('#txtNetProfit').val(),
            worth: $('#txtWorth').val(),
        };
        insertCreditGrantingS1(jsonStage1);
    });
});


function insertCreditGrantingS1(json) {

    $.ajax({
        type: "POST",
        data: JSON.stringify(json),
        dataType: "json",
        contentType: "application/json; charset=utf-8",
        url: "insertCreditGrantingS1",
        success: function (data) {
            alert("ok");
        }
    });

};